Kanzi 3.9.10
MessageArguments Class Reference

MessageArguments is the base class for arguments passed in messages. More...

Inherits NativeObject.

Inherited by ActivityConceptMetadata.ActivityInternalMessageArguments, ActivityConceptMetadata.ActivityMessageArguments, ActivityConceptMetadata.ActivityPrefabMessageArguments, ActivityConceptMetadata.StartActivationInternalMessageArguments, ActivityConceptMetadata.StatusChangedInternalMessageArguments, ActivityHostConceptMetadata.ActivationMessageArguments, ActivityHostConceptMetadata.RegisterActivityElementInternalMessageArguments, ActivityHostConceptMetadata.UnregisterActivityElementInternalMessageArguments, ButtonConceptMetadata.CanceledMessageArguments, ButtonConceptMetadata.ClickedMessageArguments, ButtonConceptMetadata.LongPressMessageArguments, ButtonConceptMetadata.PointerEnteredMessageArguments, ButtonConceptMetadata.PointerLeftMessageArguments, ButtonConceptMetadata.PressedMessageArguments, ButtonConceptMetadata.ToggleStateChangedMessageArguments, ButtonConceptMetadata.ToggledOffMessageArguments, ButtonConceptMetadata.ToggledOnMessageArguments, CommandMetadata.CommandMessageArguments, ExclusiveActivityHostConceptMetadata.ImplicitActivityChangeRequestMessageArguments, FocusManagerMetadata.InputOutsideOverlayMessageArguments, FocusManagerMetadata.MoveFocusMessageArguments, FocusManagerMetadata.PostFocusMessageArguments, FocusManagerMetadata.ScopeStateChangeMessageArguments, InputManipulatorMetadata.InputMessageArguments, InputManipulatorMetadata.KeyInputMessageArguments, KeyboardMetadata.KeyStateChangedMessageArguments, ListBoxConceptMetadata.ItemMessageArguments, ListBoxConceptMetadata.ItemSelectedMessageArguments, ListBoxScrollingConceptMetadata.ScrollMessageArguments, NodeComponentMetadata.NodeComponentMessageArguments, NodeComponentMetadata.NodeComponentSourceMessageArguments, NodeMetadata.NodeComponentMessageArguments, NodeMetadata.NodeComponentSourceMessageArguments, PageMetadata.ActivatedMessageArguments, PageMetadata.DeactivatedMessageArguments, PageMetadata.NavigateMessageArguments, PageMetadata.NavigationActivatedMessageArguments, PageMetadata.NavigationDeactivatedMessageArguments, PageMetadata.NavigationFinishedMessageArguments, PageMetadata.NavigationStartedMessageArguments, PageMetadata.RegisterToNavigationdMessageArguments, PageMetadata.UnregisterFromNavigationMessageArguments, PrefabViewConceptMetadata.AsynchronousLoadCompletedMessageArguments, PrefabViewConceptMetadata.LoadAsynchronouslyMessageArguments, RangeConceptMetadata.CommonMessageArguments, ScreenMetadata.ActivateThemeMessageArguments, ScrollViewConceptMetadata.ScrollDirectionMessageArguments, ScrollViewConceptMetadata.ScrollDownMessageArguments, ScrollViewConceptMetadata.ScrollEdgeMessageArguments, ScrollViewConceptMetadata.ScrollEndMessageArguments, ScrollViewConceptMetadata.ScrollHomeMessageArguments, ScrollViewConceptMetadata.ScrollLeftMessageArguments, ScrollViewConceptMetadata.ScrollMessageArguments, ScrollViewConceptMetadata.ScrollPageDownMessageArguments, ScrollViewConceptMetadata.ScrollPageMessageArguments, ScrollViewConceptMetadata.ScrollPageUpMessageArguments, ScrollViewConceptMetadata.ScrollRightMessageArguments, ScrollViewConceptMetadata.ScrollUpMessageArguments, ScrollViewConceptMetadata.SetScrollMessageArguments, ScrollViewConceptMetadata.SetScrollTargetMessageArguments, ScrollViewConceptMetadata.SnapRequestMessageArguments, ScrollViewConceptMetadata.ZoomedMessageArguments, StateManagerMetadata.StateManagerMessageArguments, TextBoxConceptMetadata.CursorPositionMessageArguments, TextBoxConceptMetadata.EditingStateChangedMessageArguments, TextBoxConceptMetadata.InputMethodActionMessageArguments, TextBoxConceptMetadata.InputMethodAvailableMessageArguments, TextBoxConceptMetadata.TextChangedMessageArguments, TextBoxConceptMetadata.TextCompositionStateMessageArguments, TextBoxConceptMetadata.TextContentMessageArguments, TextBoxConceptMetadata.TextInsertionMessageArguments, TextBoxConceptMetadata.TextRangeMessageArguments, TextBoxMetadata.CharacterRemovalMessageArguments, TextBoxMetadata.CursorPositionMessageArguments, TextBoxMetadata.DeleteSelectionMessageArguments, TextBoxMetadata.EditingStateChangedMessageArguments, TextBoxMetadata.InputMethodActionMessageArguments, TextBoxMetadata.InputMethodAvailableMessageArguments, TextBoxMetadata.ModifyEditingStateMessageArguments, TextBoxMetadata.ModifySelectionMessageArguments, TextBoxMetadata.MoveCursorMessageArguments, TextBoxMetadata.TextChangedMessageArguments, TextBoxMetadata.TextCompositionStateMessageArguments, TextBoxMetadata.TextContentMessageArguments, TextBoxMetadata.TextInsertionMessageArguments, TextBoxMetadata.TextRangeMessageArguments, TextInputConceptMetadata.CursorMovedMessageArguments, TextInputConceptMetadata.InputMethodActionMessageArguments, TextInputConceptMetadata.InputMethodAvailableChangedMessageArguments, TextInputConceptMetadata.InputMethodsDisconnectedMessageArguments, TextInputConceptMetadata.InputTypeChangedMessageArguments, TextInputConceptMetadata.ReadOnlyStateChangedMessageArguments, TextInputConceptMetadata.SelectionChangedMessageArguments, TextInputConceptMetadata.TextChangedMessageArguments, TextInputConceptMetadata.TextCompositionStateMessageArguments, and ToggleButtonGroupConceptMetadata.ToggleButtonGroupConceptMessageArguments.

Public Member Functions

 MessageArguments ()
 Constructs a new MessageArguments object.
 
TDataType getArgument (PropertyType< TDataType > propertyType)
 Returns the value of an argument.
 
TDataType getOptionalArgument (PropertyType< TDataType > propertyType)
 Returns the value of an argument, but does not use the default value if there are no inputs to the argument value.
 
TNodeType getSource ()
 Returns the source node for a message.
 
MessageArgumentsWrapper getWrapper ()
 Gets a wrapper for this MessageArguments.
 
boolean isHandled ()
 Returns whether the message is handled.
 
void setArgument (PropertyType< Integer > propertyType, EnumType value)
 Sets the value of an integer argument using a constant from an enumeration.
 
void setArgument (PropertyType< TDataType > propertyType, TDataType value)
 Sets the value of an argument.
 
void setHandled (boolean handled)
 Sets the handling status for a message.
 

Static Public Member Functions

static MessageArgumentsWrapper getWrapper (MessageArguments messageArguments)
 Gets a wrapper for a MessageArguments object.
 

Protected Member Functions

 MessageArguments (long nativeObject)
 Wraps a native message argument.
 
 MessageArguments (MessageArgumentsWrapper wrapper)
 Wraps a native message argument.
 

Detailed Description

MessageArguments is the base class for arguments passed in messages.

An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.

You can derive your own custom message arguments type from this class or an existing derivation of this class, where you can define the property types associated to your message and any convenience functions like getters and setters. Make sure to expose proper constructors from your class, see constructors of this class for more information.

Constructor & Destructor Documentation

◆ MessageArguments() [1/3]

Constructs a new MessageArguments object.

When deriving a custom message arguments class, you will typically call this constructor from your main constructor.

◆ MessageArguments() [2/3]

MessageArguments ( MessageArgumentsWrapper wrapper)
protected

Wraps a native message argument.

This constructor is used by Kanzi when delivering a message to a handler in Java.

When deriving a custom message arguments class, you will need to expose a constructor of matching signature, where you must simply forward the received argument to this constructor.

Parameters
wrapperReference to native message argument.

◆ MessageArguments() [3/3]

MessageArguments ( long nativeObject)
protected

Wraps a native message argument.

This constructor is used by Kanzi when delivering a message to a handler in Java.

When deriving a custom message arguments class, you will need to expose a constructor of matching signature, where you must simply forward the received argument to this constructor.

Parameters
nativeObjectReference to native message argument.

Member Function Documentation

◆ getArgument()

TDataType getArgument ( PropertyType< TDataType > propertyType)

Returns the value of an argument.

Parameters
propertyTypeThe PropertyType argument whose value to fetch.
<TDataType>Data type of the property, optional.
Returns
The value of the argument. If the argument is not present in this message arguments instance, returns the default value of the PropertyType.

◆ getOptionalArgument()

TDataType getOptionalArgument ( PropertyType< TDataType > propertyType)

Returns the value of an argument, but does not use the default value if there are no inputs to the argument value.

Parameters
propertyTypeThe PropertyType argument whose value to fetch.
<TDataType>Data type of the property, optional.
Returns
The value of the argument. If the argument is not present in this message arguments instance, returns null.

◆ getSource()

TNodeType getSource ( )

Returns the source node for a message.

Parameters
<TNodeType>The expected type of the node, optional.
Returns
The source node where the message was dispatched.

◆ getWrapper() [1/2]

MessageArgumentsWrapper getWrapper ( )

Gets a wrapper for this MessageArguments.

Returns
MessageArgumentsWrapper, or null for this MessageArguments.

◆ getWrapper() [2/2]

static MessageArgumentsWrapper getWrapper ( MessageArguments messageArguments)
static

Gets a wrapper for a MessageArguments object.

Parameters
messageArgumentsThe MessageArguments object to wrap.
Returns
A MessageArgumentsWrapper pointing to a MessageArguments object.

◆ isHandled()

boolean isHandled ( )

Returns whether the message is handled.

Returns
If the message is handled, true, otherwise false.

◆ setArgument() [1/2]

void setArgument ( PropertyType< Integer > propertyType,
EnumType value )

Sets the value of an integer argument using a constant from an enumeration.

Parameters
propertyTypeThe property type identifying the property to set.
valueThe enumeration constant to get the integer value from.
See also
MessageArguments::setArgument(PropertyType, Object)

◆ setArgument() [2/2]

void setArgument ( PropertyType< TDataType > propertyType,
TDataType value )

Sets the value of an argument.

Parameters
propertyTypeThe PropertyType argument whose value to set.
valueThe value to set for the argument.
<TDataType>Data type of the property, optional.

◆ setHandled()

void setHandled ( boolean handled)

Sets the handling status for a message.

Parameters
handledThe new handling status.